var _ = require('underscore'),
  uds = require('underscore.string');

function toKeyword(keywords) {
  var kws = keywords || [];
  if(_.isString(kws)) kws = kws.split(/[,\s]+/);
  if(kws.length <= 0) {
    kws = [];
  } else {
    kws = _.uniq(_.without(kws, ''));
  }
  return kws;
}

module.exports = [{
  name: 'Example',
  get: {
    columns: []
  },
  post: {
    columns: ['title','message'],
    unique: [],
    fixed: [],
    check: []
  },
  put: {
    columns: ['title','message']
  }
}, {
  name: 'Todo',
  get: {
    columns: [],
    anonymous: true,
    orderby: [{column: 'end', desc: true}]
  },
  post: {
    columns: ['itsm','title','detail','start','end','hours','priority','country','category'],
    unique: [],
    fixed: [],
    check: []
  },
  put: {
    columns: ['itsm','title','detail','start','end','hours','priority','country','category']
  }
}, {
  name: 'Timesheet',
  rel: {
    name: 'Todo',
    column: 'todo',
    id: 'todoid'
  },
  get: {
    columns: []
  },
  post: {
    columns: ['todoid','today','hours','detail','from','to']
  },
  put: {
    columns: ['hours','detail']
  }
}];